package cn.edu.scau.cmi.huangmaoqin.spring.clientController;

import javafx.fxml.FXML;

import javafx.scene.control.Button;
import javafx.scene.control.TextArea;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import cn.edu.scau.cmi.huangmaoqin.spring.domain.Student;
import cn.edu.scau.cmi.huangmaoqin.spring.domain.Teacher;
import javafx.event.ActionEvent;

public class SpringClientsGUIController {
	@FXML
	private Button btn;
	@FXML
	private TextArea showText;
	@FXML
	public void btn_Click(ActionEvent event) {
		ApplicationContext context=new ClassPathXmlApplicationContext("applicationContext.xml");
		Student zhangsan=(Student)context.getBean("zhangsan");
		Teacher liang=(Teacher)context.getBean("liang");
		String message=zhangsan.getName()+"是"+liang.getName()+"老师的学生\n";
		showText.appendText(message);
	}
}
